package com.boot.hospital.score.core.service.impl;

import com.boot.hospital.score.core.service.ExpertService;
import com.boot.hospital.score.dao.entity.Expert;
import com.boot.hospital.score.dao.mapper.ExpertMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
@Transactional(rollbackFor = Exception.class)
public class ExpertServiceImpl implements ExpertService {

    @Resource
    private ExpertMapper expertMapper;

    @Override
    public List<Expert> selectAll() {
        return expertMapper.selectAll();
    }

    @Override
    public int insert(Expert expert) {
        return expertMapper.insert(expert);
    }

    @Override
    public List<Expert> selectByPageAndSearch(Map<String, Object> params) {
        return expertMapper.selectByPageAndSearch(params);
    }

    @Override
    public int updateExpert(Expert expert) {
        return expertMapper.updateExpert(expert);
    }

    @Override
    public int deleteExpertsByIds(List<String> expertIds) {
        return expertMapper.deleteExpertsByIds(expertIds);
    }

    @Override
    public Expert getExpertByExpertName(String expertName) {
        return expertMapper.getExpertByExpertName(expertName);
    }

    @Override
    public int deleteExpertsByReviewIds(List<Integer> reviewIds) {
        return expertMapper.deleteExpertsByReviewIds(reviewIds);
    }
}